<!--
 * @Author: your name
 * @Date: 2022-03-04 12:19:10
 * @LastEditTime: 2022-03-04 14:27:37
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \算法测试\day0906\搜索回溯.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var exist = function (board, word) {
        //     let m = board.length, n = board[0].length;
        //     let stepNum = [[1, 0], [0, 1], [-1, 0], [0, -1]];
        //     const wordBF = function (x, y, wordNum) {
        //         if (board[x][y] === word[wordNum]) {
        //             if (wordNum === word.length - 1) return true;
        //             let str = board[x][y];
        //             board[x][y] = "";
        //             for (let i = 0; i < stepNum.length; i++) {
        //                 let newx = x + stepNum[i][0];
        //                 let newy = y + stepNum[i][1];
        //                 if (newx >=0 && newy >= 0 && newx < m && newy < n && wordBF(newx, newy, wordNum + 1)) return true;
        //             }
        //             board[x][y] = str;
        //         } else {
        //             return false;
        //         }
        //     }
        //     for (let i = 0; i < m; i++) {
        //         for (let j = 0; j < n; j++) {
        //             if (board[i][j] === word[0]) {
        //                 if (wordBF(i, j, 0)) return true;
        //             }
        //         }
        //     }
        //     return false;
        // };
        // console.log(exist([["A","B","C","E"],["A","F","C","S"],["A","D","E","E"]],"ABCB")); 
        let borad = new Array();
        // for (let i = 0; i < 3; i++) {
        //     borad[i] = [];
        //     borad[i].length = 4;
        // }
        console.log(borad);
    </script>
</body>

</html>